<?php
class ManagerAction extends BaseAction {
	public function __construct(){
		parent::__construct();
		$UserCheck = Think::instance('UserCheck');
		$UserCheck->checkUserLogin();
		$module = strtolower(MODULE_NAME);
		$action = strtolower(ACTION_NAME);
		$no_access = C('NO_CHECKING');
		if(!in_array(array($module,$action),$no_access)){			//判断是否是无需验证方法
			if(!Session::get('uid'))$this->redirect('User/login');	//检测用户是否登录
			//检测用户组是否有权限
			$auth = Session::get('auth');
			$access = C('ACCESS_RULE');
			$access = $access[$auth];
			if(!in_array(array($module,$action), $access)){
				echo "您没有{$module}-{$action}的权限";exit;
			}
			}
			$this->auth = Session::get('auth');
			$this->assign('auth',$this->auth);
			$this->assign('name',Session::get('name'));
	}
}